File Upload

The File Upload step allows users to upload one or more files during a conversation. You can configure file restrictions, handle validation errors, and control how uploaded files are processed within the flow.

Use it for processes like document submission, identity verification, and other tasks requiring file handling.

Add and Configure File Upload Step

To add and configure a File Upload step in a DRUID flow:

  1. Open the desired flow in Flow Diagram view.
  2. Expand the Flow Palette, then drag the File Upload step from the Dialog category into the main flow window and drop it onto the step you want to link it to.
  3. Select the step on the diagram, then click the Settings icon from the Actions menu.
  4. Set the General parameters:
    • Step name: Enter a descriptive name for the step to clarify its purpose (e.g., "Upload Identity Card"). This name is for internal use and helps you document the flow and understand analytics reports.
    • Step message: Enter the message the AI Agent will display to the user when it reaches this step, like "Upload the file here".
    • NOTE: Uploaded files are stored in the system entity known as [[File]]. You can store files in specific entity fields by specifying the field in Input Mapping.
      NOTE: To enable users upload multiple files in the chat via drag-and-drop, in Input Mapping, enter an entity list field that references the [[File]] entity.
  5. Set file restrictions if you need to restrict the types of files users can upload.

  6. Save the step.

Set File Restrictions

To restrict the types of files users can upload, click on the Metadata section and set the desired file restrictions:

  • Allowed file types. Specify the supported file extensions separated by comma followed by a space (e.g., .pdf, .png, .jpg, .docx).
  • Max allowed size (KB). Define the maximum allowed size per file in kilobytes.

Druid supported file extensions

Druid supports the following file extensions:

pdf png mkv
doc jpg webm
docx jpeg csv
xls tiff txt
xlsx tif json
odt mp3 vcf
ods mp4 xml (supported in DRUID 8.5 and higher)

If a user attempts to upload an unsupported file type, the AI Agent will respond with a default or customized error message defined as set in the UploadFileFailed special message (AI Agent Details > Dialogue Management > Special messages).

File Validation and Anti-Malware Scanning

All uploaded files are automatically validated and scanned by the Druid anti-malware system before being processed.

If a file fails validation (for example, unsupported type or size), the system raises the exception [[SystemError]].ExceptionType == “UnsupportedFileType” which you can handle in the flow. For more information, see Exception Handling on Flow Steps with Input Mapping.

In Druid 9.20 and higher, the system logs the event in Conversation History, including the file name (when available): "File <file name> was found corrupted by DRUID Antimalware system".

IMPORTANT! For mobile channels like MS Teams on mobile, uploaded images may automatically change to a .png extension. The antimalware check accommodates mismatches between the file extension and its signature (e.g., .png files with .jpg content).

Multiple File Upload Behavior

NOTE: In Druid version prior to 9.20, if a user uploads multiple files and only some are flagged as threats, the system rejects the entire set.

When users upload multiple files in a single step, each file is processed independently. If a user uploads multiple files and only some are flagged as threats, the system will accept the clean files into the conversation context rather than rejecting the entire set.

    • Clean files are accepted and added to the conversation context. Successfully uploaded files are available in the [[FileList]] collection.
    • Rejected files trigger the exception [[SystemError]].ExceptionType == “UnsupportedFileUpload”.
    • Rejected files are logged in the Conversation History.